#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket

server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ip_port = ("127.0.0.1", 2004)

while True:
    inp = input(">>>>: ").strip()
    if not inp: continue
    server.sendto("{}".format(inp).encode("utf-8"), ip_port)
    data, addr = server.recvfrom(4096)
    print(data.decode("utf-8"))
